package cz.muni.fi;

import java.util.List;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.ejb.EJBContext;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;

/**
 *
 * @author Martin Zitnik
 */
@Stateless
public class StewardService implements StewardServiceLocal {

    @EJB
    private StewardDAOLocal stewardDao;
    @Resource
    private SessionContext ctx;

    public void setStewardDao(StewardDAOLocal stewardDao) {
        this.stewardDao = stewardDao;
    }

    
    @Override
    public Steward get(Long id) {
        return stewardDao.get(id);
    }

    @Override
    public void create(Steward steward) {
        stewardDao.create(steward);
    }

    @Override
    public void update(Steward steward) {
        stewardDao.update(steward);
    }

    @Override
    public void remove(Steward steward) {
        stewardDao.remove(steward);
    }

    @Override
    public void refresh(Steward steward) {
        stewardDao.refresh(steward);
    }

    @Override
    public List<Steward> findAll() {
        List<Steward> stewards;
        stewards = stewardDao.findAll();
        return stewards;
    }

    @Override
    public Steward findByPersonalId(Long personalId) {
        Steward steward;
        steward = stewardDao.findByPersonalId(personalId);
        return steward;
    }

    @Override
    public List<Steward> findByAnyName(String anyName) {
        List<Steward> stewards;
        stewards = stewardDao.findByAnyName(anyName);
        return stewards;
    }
}
